<template>
  <div>
    <zm-panel title="影院数" :visible.sync="value" @change="close">
      <app-container>
        <zm-form :model="form" inline>
          <zm-form-item label="选择影院：">
            {{ obj.relationName }}
          </zm-form-item>
          <zm-form-item label="影院数：">
            {{ count }}
          </zm-form-item>
          <div>
            <zm-form-item label="影院名称：">
              <zm-input
                v-model="form.cinemaName"
                placeholder="请输入影院名称"
              ></zm-input>
            </zm-form-item>
            <zm-form-item>
              <zm-button @click="onSearch">查询</zm-button>
            </zm-form-item>
          </div>
        </zm-form>
        <zm-table-data
          :data="tableParams.data"
          :columns="columns"
          :fetch="loadList"
          :table-params="tableParams"
          :show-page="true"
        >
        </zm-table-data>
      </app-container>
      <div slot="footer" class="tr">
        <el-button @click="close" type="">返回</el-button>
      </div>
    </zm-panel>
  </div>
</template>
<script>
import tableMixin from '@/mixins/zmTableMixin'
import panelMixin from '@/mixins/panelMixin'
import cloudApis from '@/api/src/cloud'
export default {
  name: 'LookCinema',
  components: {},
  mixins: [panelMixin, tableMixin],
  props: {
    currentId: {
      type: String,
      default: ''
    }
  },
  data () {
    return {
      count: 0,
      form: {
        cinemaName: ''
      },
      columns: [
        {
          prop: 'cinemaName',
          label: '影院名称'
        },
        {
          prop: 'cinemaCode',
          label: '影院编码'
        }
      ]
    }
  },
  computed: {},
  watch: {},
  created () {},
  methods: {
    async loadList () {
      const _res = await cloudApis.getCinemaPageList(this.assignQuery({
        ...this.form,
        cinemaGroupId: this.obj.relationId
      }))
      this.initialTableData(_res.list, _res.count)
      this.count = _res.count
    }
  }
}
</script>
<style scoped lang='scss'>
</style>
